class DbLog < ActiveRecord::Base
  belongs_to :company
  belongs_to :department
  belongs_to :employee

  scope :paginate, ->(start,limit) { offset(start.to_i).limit(limit.to_i).order("id DESC")}
  
  def self.info(companyId , departmentId , employeeId , cName , aName ,ip, info)
    dbLog = DbLog.new
    dbLog.company_id = companyId
    dbLog.department_id = departmentId
    dbLog.employee_id = employeeId
    dbLog.c_name = cName
    dbLog.a_name = aName
    dbLog.ip = ip
    dbLog.description = info
    dbLog.save!    
  end
end
